#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cerrno>
#include <cstring>
#include <zlib.h>
#include "xstdlib.h"
#include "xzlib.h"

using namespace std;

gzFile safeGZOpen (const char *filename,const char *modes)
    {
    gzFile f=gzopen(filename,modes);
    if(f==NULL)
	{
	cerr << "[I/O] Cannot open " << filename << " " << strerror(errno)<< ".\n";
    	std::exit(EXIT_FAILURE);
	}
    return f;
    }



GZLineReader::GZLineReader(gzFile in):LineReader(),in(in)
     {
     }

GZLineReader::~GZLineReader()
    {
    }

bool GZLineReader::eof()
    {
    return ::gzeof(in);
    }

int GZLineReader::get()
    {
    return ::gzgetc(in);
    }

